package com.hsy.crm.web.service.asyn.marketprofit;

import com.hsy.crm.web.domain.entity.Message;
import com.hsy.crm.web.domain.entity.StoreProductDetail;
import com.hsy.crm.web.mapper.StoreProductDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 采购退货单反审核
 */
@Service
public class UnBuyBackProfitService {

    @Autowired
    StoreProductDetailMapper storeProductDetailMapper;

    public void init(Message message, List<StoreProductDetail> storeProductDetails){
        for (StoreProductDetail storeProductDetail : storeProductDetails){


            storeProductDetail.setCustomerId(message.getCustomerId());
            storeProductDetailMapper.deleteByPrimaryKey(storeProductDetail);

        }
    }

}
